import request from '@/utils/request'

// 查询协会公告列表
export function listNotice(query) {
  return request({
    url: '/content/notice/list',
    method: 'get',
    params: query
  })
}

// 查询协会公告详细
export function getNotice(id) {
  return request({
    url: '/content/notice/' + id,
    method: 'get'
  })
}

// 新增协会公告
export function addNotice(data) {
  return request({
    url: '/content/notice',
    method: 'post',
    data: data
  })
}

// 修改协会公告
export function updateNotice(data) {
  return request({
    url: '/content/notice',
    method: 'put',
    data: data
  })
}

// 删除协会公告
export function delNotice(id) {
  return request({
    url: '/content/notice/' + id,
    method: 'delete'
  })
}

// 公告状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/content/notice/changeStatus',
    method: 'put',
    data: data
  })
}
